<?php
/* @var $this CatalogItemController */
/* @var $model CatalogItem */

$this->breadcrumbs=array(
	'Catalog Items'=>array('index'),
	$model->title,
);

$this->menu=array(
	array('label'=>'List CatalogItem', 'url'=>array('index')),
	array('label'=>'Create CatalogItem', 'url'=>array('create')),
	array('label'=>'Update CatalogItem', 'url'=>array('update', 'id'=>$model->id)),
	array('label'=>'Delete CatalogItem', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Manage CatalogItem', 'url'=>array('admin')),
);
?>

<script src="<?php echo Yii::app()->request->baseUrl; ?>/assets/js/PicturesEditorController.js"></script>

<h1>View CatalogItem #<?php echo $model->id; ?></h1>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'id',
		'title',
		'description',
		'code',
		'type',
		'state',
		'view_count',
		'catalog_id',
		'user_id',
		array(
			'name'=>'pictures',
			'type'=>'raw',
			'value'=>'<div class="row" ng-controller="PicturesEditorCtrl" ng-init="init(\'\', \'\', \''.Yii::app()->request->baseUrl.'/\', \''.CHtml::encode(CJSON::encode($model->pictures)).'\')">
						<div class="large-12 columns">
							<div id="uploads" >
								<ul class="clearing-thumbs no-bullet" data-clearing>
									<li class="" ng-repeat="picture in pictures">
										<a class="th" ng-href="{{picture.url}}">
											<img width="100px" ng-src="{{picture.url}}" />
											<input type="hidden" name="pictures[]" ng-value="picture.url" />
										</a>
									</li>
								</ul>
							</div>
						</div>
					</div>'
		)
	),
)); ?>
